package com.ruoyi.tcsp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcsp.domain.bean.req.TcspTechReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcsp.mapper.TcspTechReqMapper;
import com.ruoyi.tcsp.service.ITcspTechReqService;

/**
 * 技术需求Service业务层处理
 * 
 * @author rwt
 * @date 2025-04-17
 */
@Service
public class TcspTechReqServiceImpl implements ITcspTechReqService 
{
    @Autowired
    private TcspTechReqMapper tcspTechReqMapper;

    /**
     * 查询技术需求
     * 
     * @param techReqId 技术需求主键
     * @return 技术需求
     */
    @Override
    public TcspTechReq selectTcspTechReqByTechReqId(Long techReqId)
    {
        return tcspTechReqMapper.selectTcspTechReqByTechReqId(techReqId);
    }

    /**
     * 查询技术需求列表
     * 
     * @param tcspTechReq 技术需求
     * @return 技术需求
     */
    @Override
    public List<TcspTechReq> selectTcspTechReqList(TcspTechReq tcspTechReq)
    {
        return tcspTechReqMapper.selectTcspTechReqList(tcspTechReq);
    }

    /**
     * 新增技术需求
     * 
     * @param tcspTechReq 技术需求
     * @return 结果
     */
    @Override
    public int insertTcspTechReq(TcspTechReq tcspTechReq)
    {
        tcspTechReq.setCreateTime(DateUtils.getNowDate());
        tcspTechReq.setPushTime(DateUtils.getNowDate());
        return tcspTechReqMapper.insertTcspTechReq(tcspTechReq);
    }

    /**
     * 修改技术需求
     * 
     * @param tcspTechReq 技术需求
     * @return 结果
     */
    @Override
    public int updateTcspTechReq(TcspTechReq tcspTechReq)
    {
        tcspTechReq.setUpdateTime(DateUtils.getNowDate());
        return tcspTechReqMapper.updateTcspTechReq(tcspTechReq);
    }

    /**
     * 批量删除技术需求
     * 
     * @param techReqIds 需要删除的技术需求主键
     * @return 结果
     */
    @Override
    public int deleteTcspTechReqByTechReqIds(Long[] techReqIds)
    {
        return tcspTechReqMapper.deleteTcspTechReqByTechReqIds(techReqIds);
    }

    /**
     * 删除技术需求信息
     * 
     * @param techReqId 技术需求主键
     * @return 结果
     */
    @Override
    public int deleteTcspTechReqByTechReqId(Long techReqId)
    {
        return tcspTechReqMapper.deleteTcspTechReqByTechReqId(techReqId);
    }
}
